﻿#ifndef MEDIADEMUXING_H
#define MEDIADEMUXING_H

#include <QObject>

extern "C"{
#include <libavformat/avformat.h>
#include <libavutil/error.h>
}

class mediaDemuxingPrivate;

/**
 * @class	mediaDemuxing mediaDemuxing.h mediaDemuxing.h
 *
 * @brief	A media demuxing.
 *
 * @author	戴华豪
 * @date	2015/8/1
 */
class mediaDemuxing : public QObject
{
    Q_OBJECT
public:
    explicit mediaDemuxing(QObject *parent = 0);
	~mediaDemuxing();

    /**
     * @fn	bool mediaDemuxing::open(QString mediaUrl);
     *
     * @brief	Opens the given media URL.
     *
     * @author	戴华豪
     * @date	2015/8/1
     *
     * @param	mediaUrl	URL of the media.
     *
     * @return	true if it succeeds, false if it fails.
     */
    bool open(QString mediaUrl);

    /**
     * @fn	AVFormatContext* mediaDemuxing::getFormat();
     *
     * @brief	Gets the format.
     *
     * @author	戴华豪
     * @date	2015/8/1
     *
     * @return	null if it fails, else the format.
     */
    AVFormatContext* getFormat();

signals:

public slots:

private:
    mediaDemuxingPrivate *d;
};

#endif // MEDIADEMUXING_H
